#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from lj_action.action_data import ActionData
from lj_tool.tool_time import lj_time

ad = ActionData('common_dict')


def getByCode(code):
    return ad.list({
        'rules': {
            'code__eq': code
        }
    })[0]


@lj_time('字典查询-子列表')
def listByPCode(pcode):
    dict = getByCode(pcode)
    return ad.list({
        'rules': {
            'code__pid': dict.id
        }
    })
